package com.rotsel.mh3udb.app.lists;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import com.rotsel.mh3udb.app.ListModels.NumberIconTextModel;
import com.rotsel.mh3udb.app.models.*;

public final class MaterialList {
	private static Map<Integer, MaterialModel> materialMap;
	static{
		materialMap = new HashMap<Integer, MaterialModel>();
		//TODO: add materials
	}

    public static MaterialModel getMaterialById(int id){
        return materialMap.get(id);
    }

	public static ArrayList<MaterialModel> getMaterialsByIds(ArrayList<Integer> ids){
		int capacity = ids.size();
		ArrayList<MaterialModel> resultList = new ArrayList<MaterialModel>(capacity);
		MaterialModel model;
		
		for(int i = 0; i < capacity; i++){
			model = materialMap.get(ids.get(i));
			if(model != null){
				resultList.add(model);
			}
		}
		
		return resultList;
	}

}
